home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / PInterfaces / CommResources.p < prev    next >
Encoding:
Text File  |  1992-01-29  |  3.3 KB  |  114 lines  |  [TEXT/MPS ]

  1.  
  2. {
  3. Created: Thursday, September 12, 1991 at 11:54 AM
  4.  CommResources.p
  5.  Pascal Interface to the Macintosh Libraries
  6.  
  7.   Copyright Apple Computer, Inc. 1988-1991
  8.   All rights reserved
  9. }
  10.  
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.  UNIT CommResources;
  18.  INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingCommResources}
  22. {$SETC UsingCommResources := 1}
  23.  
  24. {$I+}
  25. {$SETC CommResourcesIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingOSUtils}
  28. {$I $$Shell(PInterfaces)OSUtils.p}
  29. {$ENDC}
  30. {$SETC UsingIncludes := CommResourcesIncludes}
  31.  
  32. CONST
  33.  
  34. {    version of the Comm Resource Manager    }
  35. curCRMVersion = 2;
  36.  
  37. {    tool classes (also the tool file types)    }
  38. classCM = 'cbnd';
  39. classFT = 'fbnd';
  40. classTM = 'tbnd';
  41.  
  42. { constants general to the use of the Communications Resource Manager }
  43. crmType = 9;                { queue type    }
  44. crmRecVersion = 1;            { version of queue structure }
  45.  
  46. {    error codes }
  47. crmGenericError = -1;
  48. crmNoErr = 0;
  49.  
  50. TYPE
  51. { data structures general to the use of the Communications Resource Manager }
  52. CRMErr = OSErr;
  53.  
  54. CRMRecPtr = ^CRMRec;
  55. CRMRec = RECORD
  56.  qLink: QElemPtr;            {reserved}
  57.  qType: INTEGER;            {queue type -- ORD(crmType) = 9}
  58.  crmVersion: INTEGER;        {version of queue element data structure}
  59.  crmPrivate: LONGINT;        {reserved}
  60.  crmReserved: INTEGER;        {reserved}
  61.  crmDeviceType: LONGINT;    {type of device, assigned by DTS}
  62.  crmDeviceID: LONGINT;        {device ID; assigned when CRMInstall is called}
  63.  crmAttributes: LONGINT;    {pointer to attribute block}
  64.  crmStatus: LONGINT;        {status variable - device specific}
  65.  crmRefCon: LONGINT;        {for device private use}
  66.  END;
  67.  
  68.  
  69. FUNCTION InitCRM: CRMErr;
  70. FUNCTION CRMGetHeader: QHdrPtr;
  71. PROCEDURE CRMInstall(crmReqPtr: QElemPtr);
  72. FUNCTION CRMRemove(crmReqPtr: QElemPtr): OSErr;
  73. FUNCTION CRMSearch(crmReqPtr: QElemPtr): QElemPtr;
  74. FUNCTION CRMGetCRMVersion: INTEGER;
  75.  
  76. FUNCTION CRMGetResource(theType: ResType;theID: INTEGER): Handle;
  77. FUNCTION CRMGet1Resource(theType: ResType;theID: INTEGER): Handle;
  78. FUNCTION CRMGetIndResource(theType: ResType;index: INTEGER): Handle;
  79. FUNCTION CRMGet1IndResource(theType: ResType;index: INTEGER): Handle;
  80. FUNCTION CRMGetNamedResource(theType: ResType;name: Str255): Handle;
  81. FUNCTION CRMGet1NamedResource(theType: ResType;name: Str255): Handle;
  82. PROCEDURE CRMReleaseResource(theHandle: Handle);
  83. FUNCTION CRMGetToolResource(procID: INTEGER;theType: ResType;theID: INTEGER): Handle;
  84. FUNCTION CRMGetToolNamedResource(procID: INTEGER;theType: ResType;name: Str255): Handle;
  85. PROCEDURE CRMReleaseToolResource(procID: INTEGER;theHandle: Handle);
  86. FUNCTION CRMGetIndex(theHandle: Handle): LONGINT;
  87.  
  88. FUNCTION CRMLocalToRealID(bundleType: ResType;toolID: INTEGER;theType: ResType;
  89.  localID: INTEGER): INTEGER;
  90. FUNCTION CRMRealToLocalID(bundleType: ResType;toolID: INTEGER;theType: ResType;
  91.  realID: INTEGER): INTEGER;
  92.  
  93. FUNCTION CRMGetIndToolName(bundleType: OSType;index: INTEGER;VAR toolName: Str255): OSErr;
  94.  
  95. FUNCTION CRMFindCommunications(VAR vRefNum: INTEGER;VAR dirID: LONGINT): OSErr;
  96.  
  97. FUNCTION CRMIsDriverOpen(driverName: Str255): BOOLEAN;
  98.  
  99. FUNCTION CRMParseCAPSResource(theHandle: Handle;selector: ResType;VAR value: LONGINT): CRMErr;
  100.  
  101. FUNCTION CRMReserveRF(refNum: INTEGER): OSErr;
  102.  
  103. {  decrements useCount by one  }
  104. FUNCTION CRMReleaseRF(refNum: INTEGER): OSErr;
  105.  
  106.  
  107.  
  108. {$ENDC} { UsingCommResources }
  109.  
  110. {$IFC NOT UsingIncludes}
  111.  END.
  112. {$ENDC}
  113.  
  114.